//
//  CYHReadModel.h
//  CYHReader
//
//  Created by chenyh on 2016/9/26.
//  Copyright © 2016年 chenyh. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CYHMarkModel.h"
#import "CYHNoteModel.h"
#import "CYHChapterModel.h"
#import "CYHRecordModel.h"

@interface CYHReadModel : NSObject<NSCoding>


@property (nonatomic,strong)NSURL *resource;

@property (nonatomic,copy)NSString *content;

@property (nonatomic,strong)NSMutableArray <CYHMarkModel *> *marks;

@property (nonatomic,strong)NSMutableArray <CYHNoteModel *> *notes;

@property (nonatomic,strong)NSMutableArray <CYHChapterModel *> *chapters;

@property (nonatomic,strong)NSMutableDictionary *marksRecord;

@property (nonatomic,strong)CYHRecordModel *record;

- (instancetype)initWithContent:(NSString *)content;
- (instancetype)initWithePub:(NSString *)ePubPath;
+ (void)updateLocalModel:(CYHReadModel *)readModel url:(NSURL *)url;
+ (id)getLocalModelWithURL:(NSURL *)url;


@end
